#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N=2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//
int a[N];
void solve()
{
	int n, x; cin>>n>>x;
	int a[2*n+1]; for(int i=1;i<=2*n;i++) cin>>a[i];
	sort(a+1,a+1+2*n);
	for(int i=1;i<=n;i++) if(a[i+n]-a[i]<x) {
	    cout<<"NO\n";
	    return;
	}
	cout<<"YES\n";
}
int main()
{
	close();
	int T; cin>>T;
	while (T--) solve();
	return 0;
}

